Applied bitsPerPixel.patch to bring in bitsPerPixel support from pcds…#314
Applied bitsPerPixel.patch to bring in bitsPerPixel support from pcds…#314bhill-slac wants to merge 1 commit intoareaDetector:masterfrom
Conversation
|
I am not convinced that BitsPerPixel is something that should be added to NDArray. As far as I can tell its use is mainly as a hint to OPI displays as to the range of intensities to display. Here are my objections:
Can you explain what the main use of BitsPerPixel is? Is there any reason it cannot be changed to an attribute like ColorMode and BayerPattern? Remember NDArray is a general purpose N-Dimensional array class, not limited to imaging applications. |
|
Hi Mark, I don't understand your point about BitsPerPixel vs ColorMode and BayerPattern. All 3 are member elements of asynNDArrayDriver in my branch. Re NDProcessPlugin, I added code to update bitsPerPixel for scaling. I don't think bkgd subtraction or flat field should affect bitsPerPixel and don't see the sum operation in R3=2. Is that something new? I tend to agree w/ your last point re low light conditions. I've been enabling the scaling in the |
You have added bitsPerElement to NDArray.h as a member of NDArray class. ColorMode and BayerPattern are not members of NDArray, they are NDAttributes. They are "known attributes" in the sense that some plugins look for them and change their behavior based on their presence, or set their values under some circumstances. I think bitsPerElement is in this category of not being a fundamental property of an NDArray.
Summing is not new, it is one of the things that can be done with the recursive filter. So if I have 8-bit camera images but I sum N of them into a 16-bit output then the value of BitsPerPixel will depend on N. If the goal is to provide hints to clients for display settings then why not use NDPluginStats to find the Min and Max, or better yet use the Histogram it can produce so single bad pixels don't confuse things? |
|
@bhill-slac are you still interested in pursuing this? |
|
Closing due to inactivity and discussion from collaboration meeting about bitsPerPixel not being enough information to autoscale interfaces |
An earlier version of bitsPerPixel support was rejected as it wasn't ready.
This version has been stable and in use for over a year and seems solid.
It sets bitsPerPixel appropriately for color modes, for example, 24 for RGB.
For mono, it scales bitsPerPixel up and down as needed in ROI and scaling plugins to maximize bitsPerPixel without overflowing.
Preserves most significant 8 bitsPerPixel when converting from 16 bit data types with <= 16 bitsPerPixel to 8 bit data types.